package com.sky.controller.user;

import com.sky.result.Result;
import com.sky.service.UserService;
import com.sky.service.impl.RankingServiceImpl;
import com.sky.vo.RankingResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@Api(tags = "图书排行榜接口")
@RequestMapping("/user/ranking")
public class RankingController {
    @Autowired
    private RankingServiceImpl rankingService;

    /**
     * 获取排行榜数据
     * @param type
     * @return
     */
    @GetMapping()
    @ApiOperation("获取图书排行榜数据")
    public RankingResponse getRankingList(String type){
        RankingResponse response = rankingService.getRankingList(type);
        return response;
    }

}
